package com.yaocw.baseproject.activity;

import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.yaocw.baseproject.R;

public class LoginActivity extends BaseActivity {
    private EditText etUsername;
    private EditText etPassword;
    private Button btnLogin;
    private TextView tvRegister;
    private TextView tvRebackPassword;

    @Override
    protected int initLayout() {
        return R.layout.activity_login;
    }

    @Override
    protected void initView() {
        etUsername = findViewById(R.id.et_username);
        etPassword = findViewById(R.id.et_password);

        btnLogin = findViewById(R.id.btn_login);
        btnLogin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
//                if (etUsername.getText().toString().trim().equals("user") && etPassword.getText().toString().trim().equals("123")) {
                navigateTo(MainActivity.class);
//                } else {
//                    showToast("用户名/密码错误!");
//                }
            }
        });

        tvRegister = findViewById(R.id.tv_register);
        tvRegister.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                navigateTo(RegisterActivity.class);
            }
        });

        tvRebackPassword = findViewById(R.id.tv_reback_password);
        tvRebackPassword.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                navigateTo(RebackPasswordActivity.class);
            }
        });
    }

    @Override
    protected void initData() {

    }
}